<?php
class AMS_Core_Model_Design extends AMS_Core_Model_Abstract {
    protected $design;
    protected $stage;
    
    public function setDesign($name) {
        $this->design = $name;
        return $this;
    }
    
    public function setStage($stageName) {
        $this->stage=$stageName;
    }
    
    protected function _getDesignFile($filename,$type,$process) {
        $search = DESIGN_DIR.$process.DS.'%s'.DS.$type.DS;
        $search.=str_replace('/',DS,$filename);
        if (file_exists($found = sprintf($search,$this->design))) return $found;
        else return sprintf($search,DESIGN_DEFAULT_NAMESPACE);
    }
    
    public function getTemplate($filename) {
        return $this->_getDesignFile($filename, 'template','frontend');
    }

    public function getLayout($filename) {
        return $this->_getDesignFile($filename, 'layout','frontend');
    }

    public function getSkinUrl($filename) {
        
    }
}

?>
